<!DOCTYPE html>
<html>
<head>
<meta name="page-view-size" content="1280*720"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style>

body {
	margin: 0 0 0 0;
	width: 1280px;
	height: 100%;
	background:url(bg.jpg) no-repeat;
	font-size: 1em;
}
h1 {
	margin: 0 0 0.6em 1em;
	font-size: 160%;
	color: #fff;
}
p {
	margin-left: 2em;
	font-size: 120%;
	color: #fff;
}
ul, ol {
	margin-left: 3em;
	margin-right: 1em;
	padding: 0;
}

ul > li, ol > li {
	font-size: 120%;
	margin-bottom: .5em;
	color: #fff;
}
#errorInfoContainer {
	position:relative;

	min-width: 15em;
	max-width: 40em;
	min-height: 25em;
	max-height: 25em;
	margin-top: 9em;
	margin-left: 20em;
	z-index:1;
}
.bg {
	filter:alpha(Opacity=50);
	-moz-opacity:0.5; 
	opacity: 0.5;
	background-color:#4C8BC9;
	position:relative;
	border: 2px solid #eee;
	border-radius: 1em;
	-moz-border-radius: 1em;
	-webkit-border-radius: 1em;  
	min-width: 15em;
	max-width: 40em;
	min-height: 25em;
	max-height: 25em;
	margin: 0em auto;
	-moz-background-origin: content;
	z-index:2;
}
.container {
	font-weight: bold;
	position: relative;
	z-index: 3;
    margin: -25em auto;
}

#warningicon {
    width: 106px;
    height: 106px;
    left: 50%;
    height: 50%;
    margin: .5em auto;
	z-index:2;
}

#backMenu {
	color: yellow;
}
</style>

<script type="text/javascript">
var $G = {
	"getParameter": function (param) {
		var query = window.location.search; //获取URL"?"后面的字符串
		if (query.length == 0) {
			return "";
		}
		else {
			var iLen = param.length;
			var iStart = query.indexOf(param);
			if (iStart == -1) //判断是否有那个需要查询值的传递参数
				return ""; //没有就返回一个空值
			iStart += iLen + 1;
			var iEnd = query.indexOf("&", iStart); //判断是不是带有多个参数   &为多个参数的连接符号
			if (iEnd == -1) {
				return query.substring(iStart);
			}
			return query.substring(iStart, iEnd);
		}
	},
	"validChecker": function (type, value) {
		var t = typeof(value);
		var retValue = null;
		if (1) {//无论哪种类型, 都要进行简单判断
			switch (t) {
				case "undefined":
					return false;
					break;
				case "number":
					if (value == 0) return false;
					break;
				case "boolean":
					if (!value) return false;
					break;
				case "string":
					if (value == "") return false;
					break;
				case "object":
					if (value == null) return false;
					if (typeof(value.length) != "undefined") {
						if (value.length == 0) return false;
					}
					break;
				case "function":
					break;
				default:
					return false;
			}
		}

		if (type == "") return true;

		else if (type == "stringnum") {
			var val = parseInt(value);
			if (typeof(val) == "number") return true;
			return false;
		}
		else if (type == "ip") {
			return false;
		}
	}
}


function errorString(errorCode) {
	var errStr = "";
	code = parseInt(errorCode, 10);
	switch (code) {
		case 1:
			errStr = "不支持的协议";
			break;
		case 2:
			errStr = "网络初始化失败";
			break;
		case 3:
			errStr = "URL格式错误";
			break;
		case 5:
			errStr = "无法解析代理";
			break;
		case 6:
			errStr = "无法解析主机";
			break;
		case 7:
			errStr = "找不到服务器";
			break;
		case 21:
			errStr = "引用错误";
			break;
		case 22:
		case 34:
			errStr = "HTTP连接错误";
			break;
		case 23:
		case 26:
			errStr = "下载资源读写失败";
			break;
		case 25:
			errStr = "上传失败";
			break;
		case 27:
			errStr = "内存不足";
			break;
		case 28:
			errStr = "服务器连接超时";
			break;
		default:
			errStr = "连接失败";
			break;
	}
	return errStr;
}

function showError() {
	var errCode = $G.getParameter("errorCode");
	var errStr = errorString(errCode);
	document.getElementById("errorType").innerHTML = errStr;
}
function retry() {
	var failingURL = $G.getParameter("failingURL");
	window.location.href = failingURL;
}



function back() {
	window.history.go(-1);
}

function keyEventHandler(keyEvent) {
	keyEvent = keyEvent ? keyEvent : window.event;
	keyEvent.which = keyEvent.which ? keyEvent.which : keyEvent.keyCode;
	switch(keyEvent.which) {
	case 768:
		//vitualkeyEvent();
		return false;
		break;
	case 8: //back
		back();
		return false;
		break;
	default:
		return true; //浏览器不处理，返回true
		break;
	}
}
window.document.onkeypress = keyEventHandler;
window.onload = showError;

</script>
</head>

<body>

<div id="errorInfoContainer">

	<div class="bg"></div>	
	<div class="container">

	    <div id="warningicon">
            <img src="warning.png">
        </div>
		<h1>您指定的页面无法访问</h1>
		<p>错误类型：<span id="errorType">连接失败</span></p>
		<ul>
			<li>此站点暂时不可用或者太忙。请稍后重试，或尝试按<span id="backMenu">【菜单】</span>键返回。</li>
			<li>如果您无法载入任何页面，请检查您机顶盒的网络连接。</li>
			<li>如果您的机顶盒受到防火墙或代理服务器的保护，请确认是否被授权访问网页。</li>
		</ul>

	</div>

</div>

</body>
</html>